package com.briup.day09;

import lombok.ToString;

public class Duration {
    private int hours;
    private int minutes;
    private int seconds;

    public Duration() {
    }

    public Duration(int seconds) {
        this.hours = seconds / 3600;
        this.minutes = seconds % 3600 / 60;
        this.seconds = seconds % 3600 % 60;
    }

    public int getTotalSeconds() {
        return hours * 3600 + minutes * 60 + seconds;
    }

    @Override
    public String toString() {
        return String.format("%02d时%02d分%02d秒", hours, minutes, seconds);
    }

    public static void main(String[] args) {
        Duration duration = new Duration(3661 * 12);
        System.out.println(duration);
    }
}
